package com.ruoyi.informfrontend.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.informfrontend.mapper.SysNoticeMapper;
import com.ruoyi.informfrontend.domain.SysNotice;
import com.ruoyi.informfrontend.service.ISysNoticeService;

/**
 * 系统通知Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-22
 */
@Service
public class SysNoticeServiceImpl implements ISysNoticeService 
{
    @Autowired
    private SysNoticeMapper sysNoticeMapper;

    /**
     * 查询系统通知
     * 
     * @param id 系统通知主键
     * @return 系统通知
     */
    @Override
    public SysNotice selectSysNoticeById(Long id)
    {
        return sysNoticeMapper.selectSysNoticeById(id);
    }

    /**
     * 查询系统通知列表
     * 
     * @param sysNotice 系统通知
     * @return 系统通知
     */
    @Override
    public List<SysNotice> selectSysNoticeList(SysNotice sysNotice)
    {
        return sysNoticeMapper.selectSysNoticeList(sysNotice);
    }

    /**
     * 新增系统通知
     * 
     * @param sysNotice 系统通知
     * @return 结果
     */
    @Override
    public int insertSysNotice(SysNotice sysNotice)
    {
        sysNotice.setCreateTime(DateUtils.getNowDate());
        return sysNoticeMapper.insertSysNotice(sysNotice);
    }

    /**
     * 修改系统通知
     * 
     * @param sysNotice 系统通知
     * @return 结果
     */
    @Override
    public int updateSysNotice(SysNotice sysNotice)
    {
        sysNotice.setUpdateTime(DateUtils.getNowDate());
        return sysNoticeMapper.updateSysNotice(sysNotice);
    }

    /**
     * 批量删除系统通知
     * 
     * @param ids 需要删除的系统通知主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticeByIds(Long[] ids)
    {
        return sysNoticeMapper.deleteSysNoticeByIds(ids);
    }

    /**
     * 删除系统通知信息
     * 
     * @param id 系统通知主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticeById(Long id)
    {
        return sysNoticeMapper.deleteSysNoticeById(id);
    }
}
